CREATEFUNCTIONfn_asi_SoftCreditCMDM_Exists( @pTransNumberint, @pOrignatingActivitySeqnint, @pSoftCreditIdasvarchar(50)) RETURNSbit AS BEGIN /* JB 26-May-06 Returns a flag to indicate if there are CM/DM applied to an original Soft Credit value. The original soft credit is identified in Trans_SoftCredit by the combination of TRANS_NUMBER and ORIGINATING_ACTIVITY_SEQN. Subsequent CM/DM will have the same ORIGINATING_ACTIVITY_SEQN but different TRANS_NUMBER */ declare@existsbit set@exists=0 ifexists( select1fromTrans_SoftCredit where ORIGINATING_ACTIVITY_SEQN=@pOrignatingActivitySeqn andTRANS_NUMBER<>@pTransNumber andSOFT_CREDIT_ID=@pSoftCreditId ) set@exists=1
return@exists END
GO GRANTEXECUTEON[dbo].[fn_asi_SoftCreditCMDM_Exists]TO[IMIS] GO